package bishi.meituan;
import java.util.*;
public class meituan2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            long n = in.nextInt();
            long k = in.nextInt();
            while(k > 0) {

                if(n % 2 == 0){
                    n = n >> 1;

                }else {
                    n = n * 3 + 1;
                }
                System.out.print(n+" ");
                k--;
            }
            System.out.println();
            System.out.println(n);
        }
    }
}
